
package com.punch.common.feign;


import com.punch.common.constant.ServiceNameConstants;
import com.punch.common.feign.fallback.FeignUserServiceFallbackFactory;
import com.punch.common.model.LoginUser;
import com.punch.common.model.Result;
import com.punch.common.vo.user.user.UserExtendVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author zlt
 */

@FeignClient(name = ServiceNameConstants.USER_SERVICE, fallbackFactory = FeignUserServiceFallbackFactory.class, decode404 = true)
public interface FeignUserService {

    /**
     * 通过手机号查询用户、角色信息
     *
     * @param mobile 手机号
     */
    @GetMapping(value = "/user-anon/mobile", params = "mobile")
    LoginUser getUserByMobile(@RequestParam("mobile") String mobile);

    /**
     * 获取用户结算信息
     *
     * @param userId 用户id
     * @return long
     */
    @GetMapping(value = "/user/extend/{userId}", produces = "application/json; charset=utf-8")
    Result<UserExtendVO> getUserSettlement(@PathVariable("userId") Long userId, @RequestParam("type") Integer type);
}

